package com.chixing.service.impl;

import com.chixing.mapper.CarMapper;
import com.chixing.pojo.Car;
import com.chixing.service.CarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CarServiceImpl implements CarService {
    @Autowired
    private CarMapper carMapper;

    @Override
    public Car getById(Integer carId) {
        return carMapper.selectByPrimaryKey(carId);
    }

    @Override
    public List<Car> getAll() {
        return carMapper.selectByExample(null);
    }
}
